#pragma once
#include <vector>
#include "Vector.h"
#include "Mesh.h"

struct SFace
{
	CVector				*m_Verts;
	CVector				*m_VTextures;
	CVector				*m_Normals;

	SFace()
	{
		m_Verts = new CVector();
		m_VTextures = new CVector();
		m_Normals = new CVector();
	}

	SFace(CVector _v, CVector _vt, CVector _n)
	{
		m_Verts = new CVector(_v);
		m_VTextures = new CVector(_vt);
		m_Normals = new CVector(_n);
	}
};

class CObjParser
{

private:
	std::vector<CVector>		*m_Verts;
	std::vector<CVector>		*m_VTextures;
	std::vector<CVector>		*m_Normals;
	std::vector<SFace>			*m_Faces;
	
public:
	CObjParser();
	~CObjParser();

	std::vector<CVector> *GetVerts() { return m_Verts; }
	std::vector<CVector> *GetVTextures() { return m_VTextures; }
	std::vector<CVector> *GetNormals() { return m_Normals; }
	std::vector<SFace> *GetFaces() { return m_Faces; }
	void Clear() { m_Verts->clear(); m_VTextures->clear(); m_Normals->clear(); m_Faces->clear(); }
	
	CMesh ParseObj(const std::string);
};